package org.example.work.controller;

import lombok.RequiredArgsConstructor;
import org.example.work.dox.User;
import org.example.work.service.UserService;
import org.example.work.vo.ResultVO;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/user")
@RequiredArgsConstructor
public class UserController {
    private final UserService userService;
    @PatchMapping("password")
    public ResultVO patchPassword(@RequestBody User user, @RequestAttribute String uid) {
        userService.updateUserPassword(uid, user.getPassword());
        return ResultVO.ok();
    }
}
